﻿using System.ComponentModel;
using Util;

namespace IterationLife.Extensions.Enums
{
    /// <summary>
    /// 年级类型
    /// </summary>
    public enum GradeType
    {
        /// <summary>
        /// 小学一年级
        /// </summary>
        [Description("小学一年级")]
        PrimaryOne = 11,
        /// <summary>
        /// 小学二年级
        /// </summary>
        [Description("小学二年级")]
        PrimaryTwo = 12,
        /// <summary>
        /// 小学三年级
        /// </summary>
        [Description("小学三年级")]
        PrimaryThree = 13,
        /// <summary>
        /// 小学四年级
        /// </summary>
        [Description("小学四年级")]
        PrimaryFour = 14,
        /// <summary>
        /// 小学五年级
        /// </summary>
        [Description("小学五年级")]
        PrimaryFive = 15,
        /// <summary>
        /// 小学六年级
        /// </summary>
        [Description("小学六年级")]
        PrimarySix = 16,
        /// <summary>
        /// 初中一年级
        /// </summary>
        [Description("初中一年级")]
        JuniorOne = 21,
        /// <summary>
        /// 初中二年级
        /// </summary>
        [Description("初中二年级")]
        JuniorTwo = 22,
        /// <summary>
        /// 初中三年级
        /// </summary>
        [Description("初中三年级")]
        JuniorThree = 23,
        /// <summary>
        /// 高中一年级
        /// </summary>
        [Description("高中一年级")]
        SeniorOne = 31,
        /// <summary>
        /// 高中二年级
        /// </summary>
        [Description("高中二年级")]
        SeniorTwo = 32,
        /// <summary>
        /// 高中三年级
        /// </summary>
        [Description("高中三年级")]
        SeniorThree = 33
    }

    /// <summary>
    /// 年级类型枚举扩展
    /// </summary>
    public static class GradeTypeExtensions
    {
        /// <summary>
        /// 获取描述
        /// </summary>
        public static string Description(this FileType? type)
        {
            return type == null ? string.Empty : type.Value.Description();
        }

        /// <summary>
        /// 获取值
        /// </summary>
        public static int? Value(this FileType? type)
        {
            return type?.Value();
        }
    }
}
